import request from '@/utils/request'
import ConstTable from './ConstTable'

const api = {
    //数据加载
    GetList(query)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure`,
            method: 'GET',
            data: query
        })
    },
    //新建
    Create(dataForm)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure`,
            method: 'post',
            data: dataForm,
        })

    },
    //删除
    Delete(id)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/${id}`,
            method: 'DELETE'
        })

    },
    //修改
    Update(dataForm)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/${dataForm.id}`,
            method: 'PUT',
            data: dataForm
        })

    },

    //编辑加载
    GetInfo(dataForm)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/${dataForm.id}`,
            method: 'get'
        })
    },
    // 工厂建模信息下拉框
    getDictionaryTypeSelector(id)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/Selector/${(!!id ? id : 0)}`,
            method: 'GET'
        })
    },
    // 获取Site
    getSiteList(account)
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/GetSiteList/${account==''?'0':account}`,
            method: 'GET'
        })
    },
    // 获取所有工厂信息
    getFactoryList()
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/AllFactory`,
            method: 'GET'
        })
    },
    // 获取所有车间信息
    getWorkshopList()
    {
        return request({
           url: `${ConstTable.BaseUrl}/BaseData/Factorystructure/AllWorkshop`,
            method: 'GET'
        })
    }
    
}
export default api;

